<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 实现点击按钮切换图片 -->

    <script src="./vue.js"></script>
    <div id="app">
        <img :src="imgsrc" alt="">
        <button @click="check">点一下切换图片</button>
    </div>
    

</body>

<script>
let vue=new Vue({
    el:"#app",
    data:{
        imgsrc:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.vaopo.com%2Fd%2Ffile%2F2021%2F04%2F06%2F2b4b7625db01a98382c67814dfe5c98a.jpg&refer=http%3A%2F%2Fwww.vaopo.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1665049032&t=f33d3ce3df7e959303d5ea030c5f72fa"
    },
    methods: {
        check(){
            // 
            if(this.imgsrc=="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.vaopo.com%2Fd%2Ffile%2F2021%2F04%2F06%2F2b4b7625db01a98382c67814dfe5c98a.jpg&refer=http%3A%2F%2Fwww.vaopo.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1665049032&t=f33d3ce3df7e959303d5ea030c5f72fa"){
                this.imgsrc="https://img0.baidu.com/it/u=1997324707,1785665759&fm=253&fmt=auto&app=138&f=JPEG?w=499&h=292"
            }else{
                this.imgsrc="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.vaopo.com%2Fd%2Ffile%2F2021%2F04%2F06%2F2b4b7625db01a98382c67814dfe5c98a.jpg&refer=http%3A%2F%2Fwww.vaopo.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1665049032&t=f33d3ce3df7e959303d5ea030c5f72fa"
            }
            
        }
    },
})
</script>
</html>